Skip to content

Add query fuzz test for PRW2#7409

Merged
SungJin1212 merged 2 commits intocortexproject:masterfrom
SungJin1212:Add-fuzz-test-for-PRW2
Apr 21, 2026
Merged

Add query fuzz test for PRW2#7409
SungJin1212 merged 2 commits intocortexproject:masterfrom
SungJin1212:Add-fuzz-test-for-PRW2

Conversation

@SungJin1212
Copy link
Copy Markdown
Member

With the introduction of PRW2, we need to ensure that the new ingestion pipeline does not introduce any query results inconsistency compared to the stable PRW1 pipeline.
This PR adds a TestRW1vsRW2QueryFuzz e2e test that verifies that the query results for PRW1 and PRW2 are identical.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@dosubot dosubot Bot added the type/tests label Apr 9, 2026
@SungJin1212 SungJin1212 requested a review from yeya24 April 10, 2026 01:40
Comment thread integration/query_fuzz_test.go
@SungJin1212 SungJin1212 requested a review from friedrichg April 18, 2026 00:21
Copy link
Copy Markdown
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit

require.NoError(t, err)

seed := now.Unix()
rnd := rand.New(rand.NewSource(seed))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rnd := rand.New(rand.NewSource(seed))
rnd := rand.New(rand.NewSource(seed))
ctx := context.Background()
waitUntilReady(t, ctx, c1, c2, `{job="test"}`, start, end)

This is to ensure we get all series before testing

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212 SungJin1212 force-pushed the Add-fuzz-test-for-PRW2 branch from e7e67a7 to 1927ad8 Compare April 21, 2026 01:44
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212 SungJin1212 force-pushed the Add-fuzz-test-for-PRW2 branch from 1927ad8 to cc1f409 Compare April 21, 2026 02:27
@SungJin1212 SungJin1212 requested a review from friedrichg April 21, 2026 02:43
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 21, 2026
@SungJin1212 SungJin1212 merged commit dd0a4bc into cortexproject:master Apr 21, 2026
63 of 65 checks passed
@yeya24
Copy link
Copy Markdown
Contributor

yeya24 commented Apr 21, 2026

Not sure I got why we need a query fuzz test specifically for RWv2...
The fuzz tests are already flaky so I don't know if it helps capture issues or just add more noise.

I think we can have a test for RWv1 vs RWv2 but no need to have any query involved. Simple vector selector should be fine.

@SungJin1212
Copy link
Copy Markdown
Member Author

@yeya24
Since we already have a compatibility test between PRW1 and Prometheus (TestPrometheusCompatibilityQueryFuzz), evaluating PRW2 against PRW1 can test the compatibility between PRW2 and Prometheus.
Also, it can help when developing PRW2 natively later, in that it validates PRW1 vs PRW2 continuously.
That's right... I'm worried about a noise from the flaky test..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size/L type/tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants